#!/bin/bash

if [ "$UID" -ne 0 ]
  then echo "Please run as root"
  exit
fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Building the lib
make clean all -C lib/

rm -f /usr/bin/ltpv
rm -f /usr/lib/libLTPV.so
rm -f /usr/include/ltpv.h

sudo ln -s $DIR/bin/ltpv /usr/bin/ltpv
sudo ln -s $DIR/lib/libLTPV.so /usr/lib/libLTPV.so
sudo ln -s $DIR/header/ltpv.h /usr/include/ltpv.h

